import Cookies from 'js-cookie'

// cookie也是key-value形式
const TokenKey = 'hrsaas-token' // key-value里面的key
const timeKey = 'hrsaas-timeKey'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
// 获取时间戳
export function getTimeStamp() {
  return Cookies.get(timeKey)
}

// 存入时间戳
export function setTimeStamp() {
  return Cookies.set(timeKey, Date.now())
}

// 清除时间戳
export function removeTimeStamp() {
  return Cookies.remove(timeKey)
}
